<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags"%>
<%@ taglib prefix="ec" uri="http://www.extremecomponents.org"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<sj:head />
<sb:head />
<link rel="stylesheet" type="text/css" href="<s:url value='/static/app.css' />" />
<link rel="stylesheet" type="text/css" href="<s:url value='/static/extremecomponents.css' />" />
<title><s:text name="userList" /></title>
</head>
<body>
    <div>
        <s:form action="list" theme="bootstrap" cssClass="form-horizontal" validate="true" key="query">
            <s:div cssClass="col-xs-6">
                <s:textfield key="user.name" />
            </s:div>
            <s:div cssClass="col-xs-6">
                <s:textfield key="user.age" />
            </s:div>
            <s:div cssClass="col-xs-6">
                <s:select key="user.gender" list="@com.zjnx.train.util.Gender@ALL" listValue="%{getText(value)}" emptyOption="true"
                    listKey="value" />
            </s:div>
            <s:div cssClass="col-xs-12">
                <s:actionerror />
                <s:actionmessage />
            </s:div>
            <s:div cssClass="col-xs-offset-6 col-xs-6">
                <s:reset cssClass="btn btn-default" value="%{getText('reset')}" />
                <s:submit cssClass="btn btn-default" value="%{getText('query')}" />
            </s:div>
        </s:form>
    </div>
    <s:a href="input.action" theme="bootstrap" cssClass="btn btn-default">
        <s:text name="add" />
    </s:a>
    <ec:table items="users" var="it" retrieveRowsCallback="limit" filterRowsCallback="limit" styleClass="table table-striped"
        sortRowsCallback="limit" filterable="false" sortable="false" autoIncludeParameters="true" showPagination="true"
        showStatusBar="true" showTooltips="true" showExports="true" view="limit" action="list.action">
        <ec:exportXls fileName="userList.xls" tooltip="Export Excel" />
        <ec:exportPdf fileName="userList.pdf" headerTitle="userList" />
        <ec:row>
            <ec:column property="id" title="sequence" />
            <ec:column property="name" title="user.name" />
            <ec:column property="age" title="user.age" calc="total" calcTitle="total"/>
            <ec:column property="gender" title="user.gender" cell="enum"/>
            <ec:column property="address" title="user.address" />
            <ec:column property="operation" title="operation" >
				<a href="input.action?user.id=${it.id}" class="btn btn-default">编辑</a>
				<a href="delete.action?user.id=${it.id}" onclick="return js_confirm();" class="btn btn-default">删除</a>
            </ec:column>
        </ec:row>
    </ec:table>
</body>
</html>